package com.leetcode.周赛.第236场;

/**
 * @author: xiaomi
 * @date: 2021/4/11
 * @description: 5726. 数组元素积的符号
 */
public class A_5726_数组元素积的符号 {
    static A_5726_数组元素积的符号 action = new A_5726_数组元素积的符号();

    public static void main(String[] args) {
        test1();
        test2();
        test3();
    }

    static void test1() {
        //

        //System.out.println("res = " + res);
    }

    static void test2() {
        //

        //System.out.println("res = " + res);
    }

    static void test3() {
        //

        //System.out.println("res = " + res);
    }

    public int arraySign(int[] nums) {
        int len = nums.length;
        int countF = 0;
        for (int i = 0; i < len; i++) {
            if (nums[i] == 0) {
                return 0;
            }
            if (nums[i] < 0) {
                countF++;
            }
        }
        return (countF & 1) == 0 ? 1 : -1;
    }
}
